package ml.coursedesign.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import ml.coursedesign.entity.Student;
import ml.coursedesign.mapper.StudentMapper;
import ml.coursedesign.service.StudentService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StudentServiceImpl extends ServiceImpl<StudentMapper, Student> implements StudentService {
    @Override
    public List<Student> selectStudnetByLike(String info) {
        QueryWrapper <Student> queryWrapper = new QueryWrapper<>();
        if(!info.equals("")){
            queryWrapper.like("stu_name",info);
        }
        List<Student> students = baseMapper.selectList(queryWrapper);
        return students;

    }
}
